package com.itheima.demo;

import com.itheima.dao.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AopDemo {
    public static void main(String[] args) {
        //1. 创建springIOC容器
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");
        //2. 获取jdk动态代理对象
        UserDao userDao = ac.getBean(UserDao.class);
        //UserDaoImpl userDao = ac.getBean(UserDaoImpl.class);
        userDao.save();
//        int flag = userDao.save("adv");
//        System.out.println(flag);
    }
}
